package com.yzy.ssm.controller;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import com.yzy.ssm.po.student.Student;
import com.yzy.ssm.service.FirstService;

@Controller
@RequestMapping(value="/first")
public class FirstController {
	
	@Resource(name="firstServiceImpl")
	FirstService firstServiceImpl;
	
	@RequestMapping(value="/student")
	public String test1(Model model,Student stu) {
		String ret = "index";
		Student student = firstServiceImpl.getStudentById(stu.getSid());
		model.addAttribute("student", student);
		return ret;
	}
	
	@RequestMapping(value="/student/{sid}")
	public String test(Model model,Student stu) {
		String ret = "index";
		Student student = firstServiceImpl.getStudentById(stu.getSid());
		model.addAttribute("student", student);
		return ret;
	}
}
